program main
    use reverse_polish_mod
    implicit none
    character(len=80)::str
    write(*,*)"Input formula,surrounded with (),like (2+3*(3-4)),q to quit"
    do
        read(*,"(A)")str
        if(trim(adjustl(str))=="q")exit
        if(len_trim(str)==0)then
            write(*,*)"Input formula,surrounded with (),like (2+3*(3-4)),q to quit"
        else
            write(*,*)eval(str)
        end if
    end do
end program
